<template>
  <div>
    <p>父组件</p>
    <button @click="changeChildValue">点击修改子组件的值</button>
    <Children ref="childrenRef" />
  </div>
</template>

<script setup>
import { ref } from 'vue'
import Children from './Children.vue'

const childrenRef = ref(null)

const changeChildValue = () => {
  console.log(childrenRef.value)
  childrenRef.value.add()
}
</script>
